#ifndef __INPUTOUTPUT_HEADER
#define __INPUTOUTPUT_HEADER

#include "json/value.h"
#include <stdexcept>

class SlotTemplate;
class ShipTemplate;
class TemplateSet;
class Deployment;

class FiletypeError : public std::runtime_error {
	public:
		explicit FiletypeError(const std::string & what_arg);
};

namespace IO {
	Json::Value loadJson( std::string _filename );
	// Saves a SLOT TEMPLATE
	Json::Value saveTemplate( const SlotTemplate & _slot );

	// Saves a SHIP TEMPLATE
	Json::Value saveTemplate( const ShipTemplate & _ship );

	// Saves a TEMPLATE SET
	Json::Value saveTemplate( const TemplateSet & _set );

	// Loads one of the STANDARD SHIP TEMPLATES
	Json::Value loadStandardShipTemplate( int _shipTemplateType );

	// Loads a TEMPLATE SET
	Json::Value loadTemplateSet( std::string _filename, std::string _setName = "" );

	// Loads a DEPLOYMENT
	Json::Value loadDeployment( std::string _filename, std::string _depName = "" );

}

#endif
